package com.luoxiang.socialandroid.adapter

import android.graphics.Color
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.luoxiang.socialandroid.R
import com.luoxiang.socialandroid.bean.CallContent

class OneTouchChatAdapter(data: MutableList<CallContent>) :
    BaseQuickAdapter<CallContent, BaseViewHolder>(
        R.layout.item_one_touch_chat, data
    ) {
    var selectIndex = 0
    override fun convert(holder: BaseViewHolder, item: CallContent) {
        holder.apply {
            getView<TextView>(R.id.textEvaluateLabel).apply {
                text = item.content
                if (selectIndex == layoutPosition) {
                    background = ContextCompat.getDrawable(context,R.drawable.bg_item_one_touch_chat_type2)
                    setTextColor(Color.parseColor("#835DFF"))
                }else{
                    background = ContextCompat.getDrawable(context,R.drawable.bg_item_one_touch_chat_type1)
                    setTextColor(Color.parseColor("#666666"))
                }
            }
        }
    }
}